﻿@{
    ViewBag.Title = "文章列表";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@model List<UcAsp.Net.Model.ArticlesPage>
<div class="container-fluid">

       
            <a href="/Admin/EditArticlesPage?ArticlesID=@ViewData["PageId"]" class="btn btn-danger">添加</a>
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon"><i class="icon-th"></i></span>
                <h5>
                    类目管理</h5>
            </div>
            <div class="widget-content nopadding">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>
                                标题
                            </th>
                            <th>
                                页码
                            </th>
                            <th>
                                添加时间
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (UcAsp.Net.Model.ArticlesPage v in Model)
                        {
                            <tr>
                                <td>@v.Title
                                </td>
                                <td>@v.PageID
                                </td>
                                <td>
                                    @v.AddDateTime.ToString("yyyy-MM-dd")
                                </td>
                                <td>
                                   <a class="btn" href="/Admin/EditArticlesPage?ID=@v.ID">编辑</a><span class="btn delete" data-id="@v.ID">删除</span>
                                </td>
                            </tr>
                        }
                    </tbody>                   
                </table>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        $(".recommand").click(function () {
            $.post("/Admin/ArticlesRecommad", { ID: $(this).attr("data-id") }, function (dataresult) {
                location.reload();
            })
        });
        $(".release").click(function () {
            $.post("/Admin/ArticlesRelease", { ID: $(this).attr("data-id") }, function (dataresult) {
                location.reload();
            })
        });
        $(".delete").click(function () {
            $.post("/Admin/ArticlesDel", { ID: $(this).attr("data-id") }, function (dataresult) {
                location.reload();
            })
        });
        $("#btnSearch").click(function () {
            location.href = "/Admin/Articles/?keyword=" + $("#searchTitle").val();
        });
    })

</script>
